.class public Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;
.super Lorg/apache/cordova/CordovaPlugin;

# interfaces
.implements Ljava/util/Observer;


# instance fields
.field public a:Ljava/lang/String;

.field private b:Lorg/apache/cordova/WqCordovaActivity;

.field private c:Ljava/lang/String;

.field private d:Lorg/apache/cordova/CallbackContext;

.field private e:Ljava/util/List;

.field private f:Ljava/util/List;

.field private g:I


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lorg/apache/cordova/CordovaPlugin;-><init>()V

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->a:Ljava/lang/String;

    const-string/jumbo v0, ""

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->c:Ljava/lang/String;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->e:Ljava/util/List;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->f:Ljava/util/List;

    const/4 v0, 0x0

    iput v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->g:I

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;)Lorg/apache/cordova/WqCordovaActivity;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->b:Lorg/apache/cordova/WqCordovaActivity;

    return-object v0
.end method

.method static synthetic b(Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;)Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->c:Ljava/lang/String;

    return-object v0
.end method


# virtual methods
.method public execute(Ljava/lang/String;Lorg/apache/cordova/CordovaArgs;Lorg/apache/cordova/CallbackContext;)Z
    .locals 4

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->cordova:Lorg/apache/cordova/CordovaInterface;

    invoke-interface {v0}, Lorg/apache/cordova/CordovaInterface;->getActivity()Landroid/app/Activity;

    move-result-object v0

    check-cast v0, Lorg/apache/cordova/WqCordovaActivity;

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->b:Lorg/apache/cordova/WqCordovaActivity;

    iput-object p3, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->d:Lorg/apache/cordova/CallbackContext;

    invoke-static {}, Ljava/util/UUID;->randomUUID()Ljava/util/UUID;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/UUID;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->a:Ljava/lang/String;

    if-eqz p2, :cond_0

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->isNull(I)Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p2, v1}, Lorg/apache/cordova/CordovaArgs;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->c:Ljava/lang/String;

    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->b:Lorg/apache/cordova/WqCordovaActivity;

    invoke-virtual {v0}, Lorg/apache/cordova/WqCordovaActivity;->getThreadPool()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    new-instance v1, Lcom/waiqin365/h5/wqbluetooth/a;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/wqbluetooth/a;-><init>(Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;)V

    invoke-interface {v0, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->b:Lorg/apache/cordova/WqCordovaActivity;

    iget-object v2, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->b:Lorg/apache/cordova/WqCordovaActivity;

    const v3, 0x7f080615

    invoke-virtual {v2, v3}, Lorg/apache/cordova/WqCordovaActivity;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Lcom/waiqin365/lightapp/view/dk;->a(Landroid/content/Context;Ljava/lang/CharSequence;)V

    move v0, v1

    goto :goto_0
.end method

.method public update(Ljava/util/Observable;Ljava/lang/Object;)V
    .locals 4

    if-eqz p2, :cond_0

    instance-of v0, p2, Lcom/waiqin365/lightapp/view/a/a;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->a:Ljava/lang/String;

    check-cast p2, Lcom/waiqin365/lightapp/view/a/a;

    iget-object v1, p2, Lcom/waiqin365/lightapp/view/a/a;->a:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/waiqin365/lightapp/view/a/b;->a()Ljava/util/Observable;

    move-result-object v0

    invoke-virtual {v0, p0}, Ljava/util/Observable;->deleteObserver(Ljava/util/Observer;)V

    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/h5/wqbluetooth/WqBluetoothPrint;->d:Lorg/apache/cordova/CallbackContext;

    new-instance v1, Lorg/json/JSONObject;

    invoke-direct {v1}, Lorg/json/JSONObject;-><init>()V

    const-string/jumbo v2, "code"

    const-string/jumbo v3, "0"

    invoke-virtual {v1, v2, v3}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;

    move-result-object v1

    invoke-virtual {v0, v1}, Lorg/apache/cordova/CallbackContext;->success(Lorg/json/JSONObject;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_0
    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0
.end method
